package signGrammar.primitives;

import signGrammar.IShape;
import signGrammar.util.CShapeEvaluator;

public class CLetterShape {
	private static CShapeEvaluator e = new CShapeEvaluator();
	
	public static IShape letterA(){
		return
		e.eval(CLineShape.S(), "+",
			e.eval(
					e.eval(CLineShape.N(), "+",
						e.eval(CLineShape.NE(), "+" ,
							e.eval(CLineShape.S(), "+",
								e.eval( CLineShape.W(), "x", CLineShape.S() )
							)
						)
					),"+",
				CLineShape.E()
			)
		)
		;
	}
	
	public static IShape letterP(){
		return
		e.eval(
			e.eval("~",
				e.eval(CLineShape.N(), "-",
					e.eval( e.eval("~",
							CLineShape.N()), "x" ,
								e.eval(CLineShape.E(), "+",
									CLineShape.SW())
					)
				)
			),"+",
			e.eval("!", CLineShape.SE())
		)
		;
	}
	
	public static IShape letterR(){
		return
		e.eval(
			e.eval(
					e.eval("~",
							e.eval(CLineShape.N(), "-",
								e.eval( e.eval("~", CLineShape.N()), "x" ,
									e.eval(CLineShape.E(), "+", CLineShape.SW())
								)
							)), "x" , CLineShape.SE() ), "+",
			e.eval("!",CLineShape.SE())
		);
	}
	
	public static IShape letterB(){
		return
		e.eval(
			e.eval( e.eval("~",
					e.eval(CLineShape.N(), "-",
							e.eval( e.eval("~", CLineShape.N()), "x" ,
								e.eval(CLineShape.E(), "+", CLineShape.SW())
							)
						)), "x" ,
				e.eval(CLineShape.SE(),"+",CLineShape.W())
			)
			,"+",
			e.eval("!", CLineShape.SE())
		);
	}
	
	public static IShape letterI(){
		return
		e.eval(
			e.eval(CLineShape.N(),"x",CLineShape.S())
			,"+",
			CLineShape.S()
		);
	}
	
	public static IShape letterC(){
		return
		e.eval(
			e.eval("~",
				e.eval(
					e.eval("!", CLineShape.NW() ),"x",
					e.eval( 
						e.eval(
							e.eval(CLineShape.S(
								),"+",CLineShape.S()
							), "x", CLineShape.E()
						), "-", CLineShape.W()
					)
				)
			),"+",
			e.eval("!", CLineShape.N())
		)
		;
	}
	
	public static IShape letterG(){
		return
		e.eval(
			e.eval("~",
				e.eval(
					e.eval("!", CLineShape.NW() ),"x",
					e.eval( 
						e.eval(
							e.eval(CLineShape.S(
								),"+",CLineShape.S()
							), "x", CLineShape.E()
						), "-", CLineShape.W()
					)
				)
			),"+",
			CLineShape.N()
		)
		;
	}
	
	public static IShape letterH(){
		return
		e.eval(
			e.eval( e.eval(CLineShape.N(),"x",CLineShape.S()), "x" ,
				e.eval(CLineShape.E(),"+",e.eval(CLineShape.N(),"x",CLineShape.S()))
			),"+",
			e.eval("!",CLineShape.SE())
		)
		;
	}
	
}
